<extend name="layout/edit" />

<block name="header">
   <style type="text/css">
        .xw-form .xw-btnRow{
           text-align: left !important;
            padding-left: 180px !important;
            background: none; 
            border: none;
        }
   </style>
</block>

<block name="content">
    <div style="padding: 10px;height: 200px;">
        <control:Form id="form"/>
    </div>
</block>


<block name="js">
   <script type="text/javascript">
    var  page = (function(ns){
        
        //页面初始化
        ns.init=function(){
        	if(form.getValue('shop_id') === '' && __mode != 1){
				$.setRequest({mode:1});
			}
        	if(__mode==1){
        		form.setValue('shop_id',$.getRequest('oid'));
        	}
        }
        
        //保存
        ns.save=function(){
        	form.save(4).then(function(){
        		if(__mode==1){
        			$.setRequest({mode:2});
        		}
        		$.toast(1,"保存成功！");
        	});
        }
        
        return ns;
    }({}));
    
    //加载当前页面需要的控件和配置
    $(function(){  page.init();  });
   </script>
</block>


